

import type { Isystemconfig } from './entity';
import type { IPageParams } from '@/types/table'
import request from '@/api/request'

export function getPageList(params: IPageParams) {
  return request({
    url: '/admin/category/list/tree',
    method: 'get',
    params,
    loading: true
  }).then(res => { return { list: res } })
}

export function systemconfigDel(data) {
  return request({
    url: `/admin/category/delete`,
    method: 'post',
    data
  })
}
export function systemconfiginfo(id) {
  return request({
    url: `/admin/category/info/${id}`,
    method: 'get'
  })
}
export function systemconfigSelect(id) {
  return request({
    url: `/admin/category/select`,
    method: 'get'
  })
}

export function systemconfigAddup(data) {
  return request({
    url: `/admin/category/${!data.id ? 'save' : 'update'}`,
    method: 'post',
    data
  })
}
